/*
 * IncFile1.h
 *
 * Created: 2012-07-09 07:17:23
 *  Author: Antrykot
 */ 
#include "main.h"
#include "../sc-k/SWLcd.h"

#ifndef SCP_H_
#define SCP_H_

void setup_io();
void init_eeprom();
void put_to_sleep();
#include "../sc-k/SWLcd.h"



#define EEP_SWXA	1
#define EEP_SWXB	5
#define EEP_SWXC	9

#define EEP_WXA	70
#define EEP_WXB	75
#define EEP_WXC	80

#define EEP_SNXA		25
#define EEP_SNXB		29

#define EEP_NXA		33
#define EEP_NXB		37


#define EEP_X_SZW	41
#define EEP_X_SCW	43

#define EEP_X_ZW	63
#define EEP_X_CW	65

#define EEP_X_SZN	45
#define EEP_X_SCN	47

#define EEP_X_ZN	49
#define EEP_X_CN	51

#define EEP_X_AKU	53
#define EEP_X_POW	55


#define EEP_STN		57
#define EEP_STW1	59
#define EEP_STW2	61

#define EEP_ZERO	70
#define EEP_SPAN	74
#define EEP_TCAL	78
#define EEP_ALPH	82
#define EEP_BETA	86

#define EEP_SZERO	90
#define EEP_SSPAN	94
#define EEP_STCAL	98
#define EEP_SALPH	102
#define EEP_SBETA	106

#define EEP_PTR		128

#define EEP_WORK_TIME	110
////

extern float xxc;

extern double swxa;
extern double swxb;
extern double swxc;

extern double wxa;
extern double wxb;
extern double wxc;

extern double snxa;
extern double snxb;

extern double nxa;
extern double nxb;

extern u16 x_szw;
extern u16 x_scw;

extern u16 x_zw;
extern u16 x_cw;

extern u16 x_szn;
extern u16 x_scn;

extern u16 x_zn;
extern u16 x_cn;

extern u16 stn;
extern u16 stw1;
extern u16 stw2;

extern u16 x_aku;
extern u16 x_pow;

extern u16 eep_cnt;
extern u16 timer_cnt;
extern u16 timer_cnt_h;

#ifndef MEDIA_CH4IR		// using red connector in MIPEX_IR

#define LG_ON	//PORTB |= (1 << 7);
#define LG_OFF	//PORTB &= ~(1 << 7);

#define LR_ON	PORTB |= (1 << 7);
#define LR_OFF	PORTB &= ~(1 << 7);

#define LY_ON	//PORTB |= (1 << 5);
#define LY_OFF	//PORTB &= ~(1 << 5);

#else
#define LG_ON	//PORTB |= (1 << 7);
#define LG_OFF	//PORTB &= ~(1 << 7);

#define LR_ON	//PORTB |= (1 << 6);
#define LR_OFF	//PORTB &= ~(1 << 6);

#define LY_ON	//PORTB |= (1 << 5);
#define LY_OFF	//PORTB &= ~(1 << 5);
#endif

#endif /* INCFILE1_H_ */